<template>
	<view class="swiper">
		<swiper current autoplay circular indicator-dots="true" indicator-active-color="rgba(0, 0, 0, .6)">
			<swiper-item v-for="(item, index) in getConfig.banner" :key="index">
				<a :href="item.url">
					<uv-image :src="item.image ? item.image : '/static/images/default.png'" mode="scaleToFill"
						width="100%">
						<template v-slot:error>
							<uv-image src="/static/images/default.png" width="100%" mode="scaleToFill"></uv-image>
						</template>
					</uv-image>
				</a>
			</swiper-item>
		</swiper>
	</view>
</template>

<script lang="ts" setup>
	import { useAuthStore } from "@/stores/auth";
	const authStore = useAuthStore();
	const getConfig = authStore.getConfig();
	const banner = getConfig.banner;
</script>

<style lang="scss">
	.swiper {
		width: 100%;
		height: 100%;

		.img {
			width: 100%;
		}
	}
</style>